package simplefactory;

/**
 * 简单工厂
 * @Author: Chen Guang
 * @Date: 2019/3/25 0025 上午 9:16
 */
public class OperationFactory {
    public static Operation  createOperate(String operate){
        Operation operation = null;
        switch (operate){
            case "+":
                operation = new OperationAdd();
                break;
            case "-":
                operation = new OperationSub();
                break;
            case "*":
                operation = new OperationMulti();
                break;
            case "/":
                operation = new OperationDiv();
                break;
            default:

        }
        return operation;
    }
}
